#!/bin/bash



date1=$1
date2=$2
secdate1=`date -d $date1 +%s`
secdate2=`date -d $date2 +%s`
destdir='/v4/tmplogs/'
while [ $secdate1 -le $secdate2 ]
do
    #tar -zxf /v1/backuplogs/25/access_log.$date1.tar.gz -C $dirtmp/25/
    #tar -zxf /v1/backuplogs/32/access_log.$date1.tar.gz -C $dirtmp/32/
    #tar -zxf /v1/backuplogs/33/access_log.$date1.tar.gz -C $dirtmp/33/
    #tar -zxf /v1/backuplogs/34/access_log.$date1.tar.gz -C $dirtmp/34/
    #tar -zxf /v1/backuplogs/36/access_log.$date1.tar.gz -C $dirtmp/36/
    #tar -zxf /v1/backuplogs/37/access_log.$date1.tar.gz -C $dirtmp/37/
    date1=`date -d @$secdate1 +%Y%m%d`
	echo $date1
	
	day1=`date -d @$secdate1 +%Y/%m/%d`
	echo $day1

	secdate1=$(($secdate1 + 86400))
	
	cd /v6/LogTrees/init-statis/$day1
	
	#grep -E '/layout/phone2/item_list' /v6/LogTrees/init-statis/2011/10/29/69b81504767483cf |grep '\^200\^'| awk -F '\\^_\\^' '{print $3}' | awk '{if(index($1,"cid=96")!=0){print "96"}else if(index($1,"cid=97")!=0){print "97"} else if(index($1,"cid=85")!=0) {print "85"} else if(index($1,"cid=100")!=0 && index($1,"cid=1001")==0 && index($1,"cid=1002")==0) {print "100"} else if(index($1,"cid=95")!=0) {print "95"} else if(index($1,"cid=1001")!=0){print "1001"} else if(index($1,"cid=1002")!=0) {print "1002"}}'|sort|uniq -c|sort -r | more

	more 69b81504767483cf|grep '\^begin\^'| grep 'statis/vv' |awk -F '\\^_\\^' '{print $11}'|sort|uniq -c  > /v5/logs/20120228/iphone$date1.log
	more a1c0f66d02e2a816|grep '\^begin\^'| grep 'statis/vv' |awk -F '\\^_\\^' '{print $11}'|sort|uniq -c  > /v5/logs/20120228/aphone$date1.log

	#more nopid |awk -F '\\^_\\^' '{print $3}'|grep '/openapi-wireless/videos/.*/playurl'|awk -F '\\/' '{print $4}'|sort|uniq -c > /v5/logs/20111214/$date1.log

done
